import request from '@/utils/request'

/**
 * 获取员工列表
 * @param {*} page 当前页码
 * @param {*} size 当前页容量
 * @returns
 */
export const getEmployeesListApi = (page, size) => {
  return request({
    url: '/sys/user',
    params: {
      page,
      size
    }
  })
}

// 删除员工列表
// export function delEmployeeApi(id) {
//   return request({
//     method: 'delete',
//     url: `/sys/user/${id}`
//   })
// }

export const delEmployeeApi = (id) => {
  return request.delete(`/sys/user/${id}`)
}

// 新增员工
export function addEmployeeApi(data) {
  return request({
    method: 'post',
    url: '/sys/user',
    data
  })
}

// 批量新增接口
export const batchAddEmployeeApi = arr => {
  return request({
    url: '/sys/user/batch',
    method: 'post',
    data: arr
  })
}
